package com.wn.class30.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * myorder
 * @author 
 */
@Data
@NoArgsConstructor
public class Myorder implements Serializable {
    /**
     * 订单主键
     */
    private Integer myorderId;

    /**
     * 订单编号
     */
    private String myorderNumber;

    /**
     * 用户ID
     */
    private Integer userId;

    /**
     * 订单状态
     */
    private Integer orderStatus;

    /**
     * 下单时间
     */
    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date orderTime;

    /**
     * 订单总价
     */
    private Double totalPrice;

    /**
     * 地址ID
     */
    private Integer userAddressId;

    private User user;

    private UserAddress userAddress;

    /**
     * 订单积分
     */
    private Integer orderIntegral;

    private static final long serialVersionUID = 1L;



    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", myorderId=").append(myorderId);
        sb.append(", myorderNumber=").append(myorderNumber);
        sb.append(", userId=").append(userId);
        sb.append(", orderStatus=").append(orderStatus);
        sb.append(", orderTime=").append(orderTime);
        sb.append(", totalPrice=").append(totalPrice);
        sb.append(", userAddressId=").append(userAddressId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}